package com.rn.simple.common;

import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 * Description：合约执行器
 *
 * @author rannuo
 * @date 2019/12/4
 */
@Component
public class ContractExecutor {
    public void test() {
        CusClassLoader loader = new CusClassLoader();
        Class<?> aClass = null;
        try {
//            aClass = loader.findClass("com.rn.simple.common.MyTest");
            aClass = loader.findClass("com.ms.hibiscus.core.user.common.MyTest");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            return;
        }
        try {
            Object obj = aClass.newInstance();
            Method method = aClass.getMethod("show");
            method.invoke(obj);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
